#include "ItemEntity.h"

ItemEntity::ItemEntity()
{
    x = 0;
    y = 0;
    motionX = 0;
    motionY = 0;

    data = new ItemEntityData;
    data->mass = 0;
    data->speed = 0;
    static_cast<ItemEntityData*>(data)->useOnPickup = false;

    needsRemoval = false;
}

void ItemEntity::onCollide(Entity* e)
{
    e->pickup(this);
}

void ItemEntity::onUse(PlayerEntity* p)
{

}

bool ItemEntity::useOnPickup()
{
    return static_cast<ItemEntityData*>(data)->useOnPickup;
}

Entity* ItemEntity::clone()
{
    return new ItemEntity(*this);
}

ItemEntity::~ItemEntity()
{
    //dtor
}

ItemEntity* ItemEntity::setUseOnPickup(bool b)
{
    static_cast<ItemEntityData*>(data)->useOnPickup = b;
    return this;
}
